<template>
	<!-- 收藏列表 -->
	<view class="wm">
		<block v-if="star.length > 0">
			<view class="question" v-for="(item,i) in star" :key="item.id"  @click="goDetail(i)">
				<view class="line1">
					<view class="title">
						第{{item.queryObj.q_i}}题：
						{{item.titletype == 2 ? '点击查看详细题目内容' : item.title}}
					</view>
					<view class="type">
						{{item.type}}
					</view>
				</view>
				<view class="line2">
						<view class="complexity">
							难度:
							<block v-if="item.complexity == 1">
								<uni-icons type="star-filled" color="#FF0033"></uni-icons>
								<uni-icons type="star" color="#FF0033"></uni-icons>
								<uni-icons type="star" color="#FF0033"></uni-icons>
								<uni-icons type="star" color="#FF0033"></uni-icons>
								<uni-icons type="star" color="#FF0033"></uni-icons>
							</block>
							<block v-else-if="item.complexity == 2">
								<uni-icons type="star-filled" color="#FF0033"></uni-icons>
								<uni-icons type="star-filled" color="#FF0033"></uni-icons>
								<uni-icons type="starhalf" color="#FF0033"></uni-icons>
								<uni-icons type="star" color="#FF0033"></uni-icons>
								<uni-icons type="star" color="#FF0033"></uni-icons>
							</block>
							<block v-else-if="item.complexity == 3">
								<uni-icons type="star-filled" color="#FF0033"></uni-icons>
								<uni-icons type="star-filled" color="#FF0033"></uni-icons>
								<uni-icons type="star-filled" color="#FF0033"> </uni-icons>
								<uni-icons type="star-filled" color="#FF0033"></uni-icons>
								<uni-icons type="star-filled" color="#FF0033"></uni-icons>
							</block>
						</view>
						<view class="time">
							更新时间：{{item.update_time}}
						</view>
					</view>
			</view>
			
		</block>
		<block v-else>
			<no-data></no-data>
		</block>
	
	</view>
</template>

<script>
	//引入vuex的star模块
	import {mapState} from "vuex"
	export default {
		data() {
			return {
			}
		},
		onLoad(option){
		},
		computed:{
			//收藏的数据
			...mapState("m_star",['star'])
		},
		methods: {
			/**
			 * @param {Number} i 收藏列表中的索引编号
			 */
			goDetail(i){
				uni.navigateTo({
					url:"/subpkg/star_detail/star_detail?index="+i,
				})
			},
			/**
			 * 修改答案和解析的显示与隐藏状态
			 * @param {Boolean} status true显示答案，false隐藏答案
			 */
			changeShow(status){
				this.showvip = status
			}
		},
	}
</script>

<style lang="scss">
@font-face {
	font-family: CustomFont;
	src: url('./iconfont.ttf');
}
.question{
	background-color:#fff;
	border-radius: 10rpx;
	margin-top:10rpx;
	padding:30rpx 10rpx;
}
.line1{
	display: flex;
	justify-content: space-between;
	.title{
		height:40rpx;
		width:78%;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		font-size:30rpx;
		line-height:40rpx;
	}
	.type{
		height:40rpx;
		width:15%;
		text-align: center;
		color: #fff;
		font-size:25rpx;
		line-height: 40rpx;
		border-radius: 8rpx;
		background:linear-gradient(to right,#68d0e3,#93bdf3);
	}
}
.line2{
	height:40rpx;
	display:flex;
	justify-content: space-between;
	margin-top:20rpx;
	.complexity{
		display: flex;
		justify-content: left;
		align-items: center;
		height:40rpx;
		font-size:25rpx;
	}
	.time{
		height:40rpx;
		font-size:25rpx;
	}
}
.lock{
	height: 100rpx;
	background-color:#fff;
	border-radius: 10rpx;
	margin-top:10rpx;
	padding:30rpx 10rpx;
	display: flex;
	justify-content: center;
	align-items: center;
}

</style>
